Skip to content

Fix example test suites without result generated by testing/codegen#216

Merged
raphael merged 4 commits into
v3from
testing-suite-test-without-payload-result
Oct 19, 2025
Merged

Fix example test suites without result generated by testing/codegen#216
raphael merged 4 commits into
v3from
testing-suite-test-without-payload-result

Conversation

@tchssk
Copy link
Copy Markdown
Member

@tchssk tchssk commented Oct 19, 2025

No description provided.

@tchssk tchssk marked this pull request as ready for review October 19, 2025 03:48
@tchssk tchssk requested a review from Copilot October 19, 2025 03:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes example test suites without result generated by testing/codegen by ensuring proper handling of methods that return results versus those that don't. The changes update the test template generation to conditionally handle result variables and add comprehensive test coverage for both scenarios.

  • Consolidated template logic to handle both result and non-result methods in a single line
  • Added test data with examples for both with-result and without-result service scenarios
  • Created comprehensive test suite to verify correct generation for both method types

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
testing/codegen/testdata/code.go Added test data constants for with-result and without-result service harness code
testing/codegen/templates/suite_test.go.tpl Simplified template to conditionally handle result variables based on method signature
testing/codegen/suite_test.go Added comprehensive test suite to verify correct suite generation for both method types

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread testing/codegen/testdata/code.go
Comment thread testing/codegen/testdata/code.go
@raphael
Copy link
Copy Markdown
Member

raphael commented Oct 19, 2025

This is great, thank you!

@raphael raphael merged commit 46cdf8e into v3 Oct 19, 2025
5 checks passed
@raphael raphael deleted the testing-suite-test-without-payload-result branch October 19, 2025 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants